package com.abc.config.demo.controller;

import com.abc.config.demo.service.EchoService;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

// 动态刷新配置
@RefreshScope
@RestController
public class ProductController {

    @Value("${product.name}")
    private String productName;

    // Feign封装的远程调用接口
    @Autowired
    private EchoService echoService;

    @GetMapping("/echo/product-name")
    public String echoProductName() {
        return echoService.echo(productName);
    }


}
